package com.guanghua.brick.html;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class InputControl extends WebControl {
	
	//private static Log logger = LogFactory.getLog(InputControl.class);
	
	private String type = "text";

	@Override
	public String buildHTML(HttpServletRequest request, HttpServletResponse response) {
		StringBuffer html = new StringBuffer();
		html.append("<input id=\"")
			.append(this.getId())
			.append("\" type=\"")
			.append(this.getType())
			.append("\" name=\"")
			.append(this.getName())
			.append("\" value=\"")
			.append((this.getData()!=null)?this.getData():"")
			.append("\" ")
			.append(this.getHtml())
			.append("/>\n");
		return html.toString();
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

}
